home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Inne / Gry / Carnage_Contest / scripts / CC Original / weapons / Hellfire.lua < prev    next >
Text File  |  2010-03-06  |  1KB  |  43 lines

  1. --------------------------------------------------------------------------------
  2. -- Weapon Hellfire
  3. -- Original Carnage Contest Weapon
  4. -- Script by DC, September 2009, www.UnrealSoftware.de
  5. --------------------------------------------------------------------------------
  6.  
  7. -- Setup Tables
  8. if cc==nil then cc={} end
  9. cc.hellfire={}
  10.  
  11. -- Load & Prepare Ressources
  12. cc.hellfire.gfx_wpn=loadgfx("weapons/hellfire.png")                            -- Weapon Image
  13. setmidhandle(cc.hellfire.gfx_wpn)
  14. cc.hellfire.sfx_attack=loadsfx("hellfire.ogg")                                -- Hellfire Sound
  15.  
  16. --------------------------------------------------------------------------------
  17. -- Weapon: Hellfire
  18. --------------------------------------------------------------------------------
  19.  
  20. cc.hellfire.id=addweapon("cc.hellfire","Hellfire",cc.hellfire.gfx_wpn,0,2)    -- Add Weapon (0 uses, first in round 2)
  21.  
  22. function cc.hellfire.draw()                                                    -- Draw
  23.     -- do nothing
  24. end
  25.  
  26. function cc.hellfire.attack(attack)                                            -- Attack
  27.     if (weapon_shots<=0) then
  28.         if (attack==1) then
  29.             -- No more weapon switching!
  30.             useweapon(0)
  31.             weapon_shots=weapon_shots+1
  32.             -- Effect
  33.             playsound(cc.hellfire.sfx_attack)
  34.             setbgcolor(255,50,0,1.0,0.005)
  35.             -- Fire
  36.             for x=0,getmapwidth(),50 do
  37.                 createobject(o_fire,x,-100)
  38.             end
  39.             -- End Turn
  40.             endturn()
  41.         end
  42.     end
  43. end